package com.lhkj.ct.meta.modules.patient.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lhkj.ct.base.enums.DeleteStatus;
import com.lhkj.ct.base.model.IBaseTree;
import com.lhkj.ct.base.model.Tree;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 单位信息表
 * </p>
 *
 * @author jobob
 * @since 2023-09-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="TblPatUnit对象", description="单位信息表")
public class TblPatUnit implements IBaseTree<String>, Tree<TblPatUnit> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "团体id")
    private String id;

    @ApiModelProperty(value = "父级id")
    private String parentId;

    @ApiModelProperty(value = "祖级节点id")
    private String treePath;

    @ApiModelProperty(value = "单位名称")
    private String unName;

    @ApiModelProperty(value = "单位代码")
    private String unCode;

    @ApiModelProperty(value = "单位简称")
    private String unAlias;

    @ApiModelProperty(value = "单位地址")
    private String unAddress;

    @ApiModelProperty(value = "单位联系人")
    private String unContact;

    @ApiModelProperty(value = "联系电话")
    private String unPhone;

    @ApiModelProperty(value = "邮件地址")
    private String unEmail;

    @ApiModelProperty(value = "传真")
    private String unFax;

    @ApiModelProperty(value = "邮编")
    private String unZipCode;

    @ApiModelProperty(value = "单位简介")
    private String unIntro;

    @ApiModelProperty(value = "拼音简码")
    private String pyCode;

    @ApiModelProperty(value = "五笔简码")
    private String wbCode;

    @ApiModelProperty(value = "等级")
    private Integer level;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    @ApiModelProperty(value = "备注")
    private String remark;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建人")
    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "修改人")
    private String updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updateTime;

    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "删除状态 0.未删除 1.已删除")
    private DeleteStatus delFlag;

//    @Deprecated
//    @ApiModelProperty(value = "所属机构(预留,暂时不用）")
//    private String organId;

    @TableField(exist = false)
    @ApiModelProperty(value = "单位所包含的档案数量")
    private Long patCount;

    @TableField(exist = false)
    @ApiModelProperty(value = "子级单位")
    private List<TblPatUnit> children;

}
